package com.termux.project

import android.util.Log
import com.termux.utils.CommandUtil
import org.apache.commons.io.FileUtils
import java.io.File
import com.termux.frontend.config.NeoTermPath


class Project(var type: String?, var projectDir: String?,var execFilePath: String?) {
    val OUT_FILE: String = "${NeoTermPath.USR_PATH}/tmp/a.out"

    fun copyFile() {
        val srcFile = File("${projectDir}/${execFilePath}")
        val destFile = File(OUT_FILE)
        if (srcFile.exists()) {
            FileUtils.copyFile(srcFile,destFile)
        }
        val result = CommandUtil.run("chmod +x $OUT_FILE")
        Log.d("idea", result)
    }
}